package com.situ.mall.order.listener;

import com.situ.mall.order.service.impl.OrderInfoServiceImpl;
import com.situ.mall.pojo.entity.order.OrderInfo;
import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class SpringRabbitListener {
    @Autowired
    private OrderInfoServiceImpl orderInfoService;
    @RabbitListener(bindings = @QueueBinding(
            value = @Queue("delay.queue"),
            exchange = @Exchange(name = "delay.topic", delayed = "true"), //type类型是：x-delayed-message
            key = "delay"
    ))
    public void listenDelayMessage(String msg) {
        //1分钟后检查订单状态作出回应
        System.out.println(msg);

    }
}
